export default class RoomFactory {
  create(t, e) {
    const s = { x: 0, y: 0, z: 0 }
    const i = { x: 0, y: 0, z: 0 }
    let r = !0
    let n = !0
    ;((e =
      e ||
      new (class RoomElement {
        id: any
        floorInfo: any
        bounds: { max: any; min: any }
        constructor() {
          ;(this.id = t.id),
            (this.floorInfo = Object.assign({}, t.floorInfo)),
            (this.bounds = { max: Object.assign({}, t.bounds.max), min: Object.assign({}, t.bounds.min) })
        }
        get size() {
          return (
            r &&
              ((r = !1),
              (s.x = this.bounds.max.x - this.bounds.min.x),
              (s.y = this.bounds.max.y - this.bounds.min.y),
              (s.z = this.bounds.max.z - this.bounds.min.z)),
            s
          )
        }
        get center() {
          return (
            n &&
              ((n = !1),
              (i.x = 0.5 * (this.bounds.max.x + this.bounds.min.x)),
              (i.y = 0.5 * (this.bounds.max.y + this.bounds.min.y)),
              (i.z = 0.5 * (this.bounds.max.z + this.bounds.min.z))),
            i
          )
        }
      })()).id = t.id),
      (e.floorInfo = Object.assign({}, t.floorInfo)),
      (e.bounds.min = Object.assign({}, t.bounds.min)),
      (e.bounds.max = Object.assign({}, t.bounds.max)),
      (r = !0),
      (n = !0)
    return e
  }
}
